<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
    <style>
        .container {
            width: 400px;
            height: 200px;
            background-color: #ccc;
        }
        .container ul {
            padding: 0;
            margin: 0;
            list-style: none;
        }
        .container ul li {
            height: 50px;
            border-bottom: 5px solid #000;
        }
        .container ul li:nth-child(1) {background-color: red;}
        .container ul li:nth-child(2) {background-color: green;}
        .container ul li:nth-child(3) {background-color: blue;}
    </style>
</head>
<body>
    <div class="container">
        
    </div>

    <script>
        // 获取container标签
        var ele = document.querySelector(".container");

        // 设置超文本
        // 字符串
        var str = ''
            str +='<ul>'
            str +='    <li></li>'
            str +='    <li></li>'
            str +='    <li></li>'
            str +='</ul>'

        // 渲染字符串
        ele.innerHTML = str;         // 写
        // console.log(ele.innerHTML);  // 读


        // 填充纯文本 
        // ele.innerText = str;            // 写
        // console.log(ele.innerText);     // 读




    </script>
</body>
</html>